<?
require_once("sqlconn.php");
include_once("miscel.php");

/* Delete all session / cookie data */
if($_GET['perm']=="yes")
{
	$tok= mysql_real_escape_string($_SESSION['token']);
	$query = "DELETE * FROM users WHERE token = '".$_SESSION['token']."'";
	@mysql_query($query) or logs(mysql_error());
}

session_start();
if (ini_get("session.use_cookies")) {
    $params = session_get_cookie_params();
    setcookie(session_name(), '', time() - 42000,
        $params["path"], $params["domain"],
        $params["secure"], $params["httponly"]
    );
}

$_SESSION = array();

setcookie('token', '');

